<UserControl x:Class="MapControlInteractiveSdk.Tutorials.UIElements.HSMap"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl">

    <Border Background="#4d4139" CornerRadius="20" Margin="0,20,0,0" Opacity="0.9">

        <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <m:Map CredentialsProvider="ApczhF4-7TYmjUY7VVJEDIXR14jVZOQttW9r7a1Mkl_qAwejv9CEPFkmuIPPu8fa" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="MyMap"  Grid.Column="1" Grid.Row="0">
            <m:MapLayer>
                <Canvas Width="10" Height="10" Background="Blue" m:MapLayer.Position="0,0" m:MapLayer.PositionOrigin="Center"></Canvas>
            </m:MapLayer>
            <m:MapLayer x:Name="MyLayer" />
        </m:Map>

        <!--
        **************************************************************************************************************
        The below Source is for drawing the menu and can be ignored.
        **************************************************************************************************************
        -->
        <StackPanel Orientation="Vertical" Background="White" Grid.Column="0" Grid.Row="0">
            <TextBlock>Position:</TextBlock>
            <Grid Margin="10,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                
                <TextBlock Grid.Column="0" Grid.Row="0">Lat:</TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="1">Lon:</TextBlock>
                <TextBox x:Name="LatValue" Grid.Column="1" Grid.Row="0" Text="0.0" />
                <TextBox x:Name="LonValue" Grid.Column="1" Grid.Row="1" Text="0.0" />
            </Grid>
            <TextBlock>Position Origin:</TextBlock>            
            <RadioButton x:Name="CustomOriginButton" GroupName="PositionGroup" Margin="10,0,0,0" VerticalAlignment="Bottom">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    
                    <TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">Origin:</TextBlock>
                    <TextBlock Grid.Column="0" Grid.Row="1" Margin="20,0,0,0">X:</TextBlock>
                    <TextBlock Grid.Column="0" Grid.Row="2" Margin="20,0,0,0">Y:</TextBlock>
                    <TextBox x:Name="XOriginValue" Grid.Column="1" Grid.Row="1" Text="0" />
                    <TextBox x:Name="YOriginValue" Grid.Column="1" Grid.Row="2" Text="0" />
                </Grid>
            </RadioButton>
            <RadioButton x:Name="PositionBottomCenterButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>BottomCenter</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionBottomLeftButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>BottomLeft</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionBottomRightButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>BottomRight</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionCenterButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>Center</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionNoneButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>None</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionTopCenterButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>TopCenter</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionTopLeftButton" GroupName="PositionGroup" Margin="10,0,0,0" IsChecked="true">
                <TextBlock>TopLeft</TextBlock>
            </RadioButton>
            <RadioButton x:Name="PositionTopRightButton" GroupName="PositionGroup" Margin="10,0,0,0">
                <TextBlock>TopRight</TextBlock>
            </RadioButton>
            <TextBlock>Position Offset:</TextBlock>
            <Grid Margin="10,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Column="0" Grid.Row="0">X:</TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="1">Y:</TextBlock>
                <TextBox x:Name="XOffsetValue" Grid.Column="1" Grid.Row="0" Text="0.0" />
                <TextBox x:Name="YOffsetValue" Grid.Column="1" Grid.Row="1" Text="0.0" />
            </Grid>
            <Button Click="AddButton_Click">
                <TextBlock>Add</TextBlock>
            </Button>
            <Button Click="ChangePositionButton_Click">
                <TextBlock>Change Position</TextBlock>
            </Button>
            <Button Click="ChangePostionOriginButton_Click">
                <TextBlock>Change Position Origin</TextBlock>
            </Button>
            <Button Click="ChangePositionOffsetButton_Click">
                <TextBlock>Change Position Offset</TextBlock>
            </Button>
            <Button Click="ChangeRemoveAllButton_Click">
                <TextBlock>Remove all</TextBlock>
            </Button>
        </StackPanel>
    </Grid>

    </Border>
</UserControl>    